
/**
 * Record pre-insert trigger.
 * Validate the record to be inserted.
 * When false is returned the record will not be inserted in the database.
 * When an exception is thrown the record will also not be inserted in the database but it will be added to databaseManager.getFailedRecords(),
 * the thrown exception can be retrieved via record.exception.getValue().
 *
 * @param {JSRecord<db:/infocom/movim_cyb>} record record that will be inserted
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"41B2170C-9FE6-44D6-8587-1AE3A1F1015A"}
 */
function onMovim_cybRecordInsert(record) {
	if (record.cod_movim == 1 )
	{
		record.ingreso 	= record.importe
		record.egreso 	= null
	}
	else
	{
		record.ingreso 	= null
		record.egreso 	= record.importe
	}
	return true
}
